treetop: A Shiny-based application and R package for extracting forest information from LiDAR data for ecologists and conservationists
Handling Editor: Laura Graham
Abstract
- Individual tree detection (ITD) and crown delineation are two of the most relevant methods for extracting detailed and reliable forest information from LiDAR (Light Detection and Ranging) datasets. However, advanced computational skills and specialized knowledge have been normally required to extract forest information from LiDAR.
- The development of accessible tools for 3D forest characterization can facilitate rapid assessment by stakeholders lacking a remote sensing background, thus fostering the practical use of LiDAR datasets in forest ecology and conservation. This paper introduces the treetop application, an open-source web-based and R package LiDAR analysis tool for extracting forest structural information at the tree level, including cutting-edge analyses of properties related to forest ecology and management.
- We provide case studies of how treetop can be used for different ecological applications, within various forest ecosystems. Specifically, treetop was employed to assess post-hurricane disturbance in natural temperate forests, forest homogeneity in industrial forest plantations and the spatial distribution of individual trees in a tropical forest.
- treetop simplifies the extraction of relevant forest information for forest ecologists and conservationists who may use the tool to easily visualize tree positions and sizes, conduct complex analyses and download results including individual tree lists and figures summarizing forest structural properties. Through this open-source approach, treetop can foster the practical use of LiDAR data among forest conservation and management stakeholders and help ecological researchers to further understand the relationships between forest structure and function.
Highlights
- A Shiny-based application and R package for forest structure assessment from LiDAR data
- Individual tree assessments of forest disturbance after Hurricane Michael
- Tree competitive dominance analysed by Lorenz curves and spatial distribution of individual trees
1 treetop: AN OPEN-SOURCE TOOL
An enhanced understanding of forest structure and ecology using airborne LiDAR (Light Detection and Ranging) can be gained through improved data analysis tools and optimized data processing frameworks that simplify working with LiDAR data. The aim of this paper is to present treetop, a freely available, open access web-based LiDAR analysis tool, and a standalone R package (treetop). treetop is capable of fast and effective individual tree detection (ITD) and crown delineation from LiDAR-derived canopy height models (CHMs), to support and enhance LiDAR-based forest monitoring, conservation initiatives and forest ecology research as well industrial uses. For demonstrative purposes, we present three case studies: (a) post-hurricane disturbance assessment of longleaf pine (Pinus palustris Mill.) forests in the Florida Panhandle (Section 2.1); (b) analysis of competitive dominance conditions through structural heterogeneity in eucalyptus (Eucalyptus grandis) and loblolly pine (Pinus taeda L.) forest plantations in South Brazil (Section 2.2); and (c) assessment of changes in spatial patterns of individual tree distributions in tropical forest in the Western Brazilian Amazon (Section 2.3).
1.1 Background and model foundation
The use of LiDAR for ITD and crown delineation is promising; however, it requires specific training in computational methods for practitioners to derive reliable forest information from LiDAR datasets (Valbuena et al., 2014). A LiDAR-derived CHM can be used to detect individual trees, delineate their crowns and subsequently estimate biophysical attributes such as biomass, stem volume and gap fraction (Silva et al., 2016; Stark et al., 2012). The CHM is defined as the spatially explicit height of the tallest vegetation and is essentially computed by subtracting the digital terrain model (DTM) from the digital surface model (DSM) representing the scanned vegetation (Figure 1). The simplest method to detect individual trees on the LiDAR-derived CHM is by using the local maximum (LM) algorithm. LM methods assume that local height maxima in the CHM represent tree tops (Korpela et al., 2006), and the method is a relatively straightforward technique that utilizes two major parameters: a smoothing parameter, which is also often mentioned as smoothing window size (SWS), and a fixed window size (FWS) for tree detection (Silva et al., 2016). As FWS increases, the number of trees detected decreases (Mohan et al., 2017). Application of smoothing filters helps eliminate spurious local maxima caused by, say, large spreading tree branches, and thereby limits the number of local maxima detected, increasing the accuracy of the algorithm (Lindberg & Hollaus, 2012). Once, individual trees are detected, their crown boundaries can be delimited using the Voronoi tessellation-based algorithm developed by Silva et al. (2016) (Figure 2). The algorithm uses maximum crown factor and exclusion parameters, both ranging from 0 to 1, to define the crown boundaries on the LiDAR-CHM (Silva et al., 2016).


treetop is both an interactive online tool as well as a standalone R package (Silva et al., 2021) that puts complex ITD and crown delineation procedures easily within reach of any non-specialized user, allowing the visualization of forest information promptly and the ability to download generated results in a variety of file formats. The tool was developed using RStudio, a free and open-source integrated development environment for R (R Core Team, 2018), and the Shiny package in R (Chang et al., 2019). The online version of treetop is publicly available on the shinyapps.io, a service platform for hosting Shiny web apps, at https://carlosasilva.shinyapps.io/weblidar-treetop/ and has limited size for input (30 Megabytes). The R package version of treetop can run natively on a user's computer and can be downloaded via the Comprehensive R Archive Network (CRAN) (https://cran.r-project.org/web/packages/treetop/index.html). In addition, it can be installed directly in R install.packages (treetop) and launched by the single command line launchApp(). The R package launches a native Shiny-based app identical to the treetop web-based tool.
We used the LM, SWS and FWS algorithms for ITD (Figure 2) along with three CHM filter options and a Voronoi tessellation-based algorithm for crown delineation. This algorithm and ITD accuracy have been already validated in Silva et al. (2016) and Leite et al. (2020). Optionally, the user can estimate tree crown width using a list of equations available in the application (Popescu et al., 2014) or even by a user-defined custom equation.
1.2 System design and features
The requested data input for ITD through the treetop application is a LiDAR-derived CHM in raster format, and thus CHM-derived from other remote sensing sources can also be used. The R package version of treetop does not have any data size limitations, thus allowing users to process larger CHM rasters. The treetop tool is capable of providing crown change estimates from multitemporal data as highlighted in our first case study. The treetop application graphical user interface (GUI) has five major panels: (a) the settings menu; (b) the summary of the LiDAR metrics; (c) the CHM profile (frequency distribution and box and whiskers plots) or spatial pattern analysis; (d) the individually detected trees represented over the CHM or Lorenz curve analysis of tree size heterogeneity; and (e) an interactive 3D viewer of the CHM or a reconstruction of individually detected trees (Table 1; Figure 3). Furthermore, there are eight buttons to download the generated results, depending on the users' choices, which include: (a) metrics summarizing the distribution of LiDAR heights in the CHM; (b) a figure of the CHM profile, which includes the frequency distribution and box plots; (c) a figure showing the detected trees and crowns over the CHM; (d) the LiDAR-derived trees with the tree location and crown width estimates; (e) two buttons for downloading the resulting tree positions and delineated crowns in shapefile format; (f) spatial pattern analysis of detected trees; and (g) Lorenz curve analysis of differences in height among the detected trees.
| Panel | Features/options | Description |
|---|---|---|
| Page 1: Application | The interactive tool for LiDAR processing | |
| Panel a) | Input CHM file | Allows the user to import their own CHM (as raster file in.tif, .asc or .img format) with grid cell size higher than 0.5 m. An example CHM is also provided. When uploaded CHM with grid cell <0.5 m, the tool resamples the CHM from its original spatial resolution to 0.5 m using the nearest neighbour approach |
| Tree Height Threshold | The user can set the tree height threshold for ITD. The default is breast height, or 1.37 m | |
| FWS | Fixed window size (FWS) used in LM algorithm for ITD. The user can customize the FWS ranging from 3 × 3 to 17 × 17 | |
| CHM colour | CHM colour options | |
| Select tiles | Tile selection for processing | |
| Crown colour | Individual tree crown boundary colour options | |
| Tree top colour | Detected tree top colour options | |
| CHM profile colour | CHM profile colour options: Frequency distribution and box plots | |
|
Tree Crown delineation/
|
Allows the user to set parameters for delineating individual tree crowns.
Maxcrown defines the maximum crown diameter of a tree as a proportion of its height; Exclusion is the proportion of tree height under which pixels are excluded from the crown.
|
|
Smoothing CHM/
|
Option for smoothing the CHM prior to running the LM algorithm for ITD.
|
|
| CHM 2d/Lorenz curve | Option to switch information displayed in panel (d) between: (1) individual trees and crown detected over the CHM, or (2) Lorenz curve showing detected tree height heterogeneity | |
| CHM profile/Ripley's K and L | Option to switch information displayed in panel (c) between: (1) frequency distribution and box plots of canopy, or (2) Lorenz curve for analysing heterogeneity in detected tree heights | |
| CHM 3d/Trees 3d | Option to switch interactive 3D information displayed in panel (e) between: (1) CHM; or (2) detected trees. Selecting Trees 3d creates a visual reconstruction of trees using a solid, mesh or line surfaces and with their crowns being optional Cones (e.g. conifer), Ellipsoids (e.g. broadleaved), halfellipsoid, paraboloid or cylinder 3D shapes (see Table S1) | |
| Run | Start the data processing | |
| Refresh app | Refresh the web-tool | |
| Panel b) | Summary of LiDAR height metrics | Summary of LiDAR-derived crown height statistics of the individual tree detection results |
| Panel c) | Canopy height model profile | CHM profile as a frequency distribution, and box plot figures showing the distribution of detected tree heights and crown areas. Requires that CHM profile is selected in panel (a) |
| Download LiDAR metrics | Button for downloading LiDAR metrics displayed in panel (b). Requires that CHM profile is selected in panel (a) | |
| Download CHM profile | Button for downloading CHM profile displayed in panel (c) figure as .tif file. Requires that CHM profile is selected in panel (a) | |
| Spatial pattern analysis | Ripley’s K and L functions from detected tree positions, including Clark-Evans index. Requires that Ripley’s K and L are selected in panel (a) | |
| Download Ripley's K and L | Button for downloading results of spatial pattern analysis as .tif file. Requires that Ripley's K and L are selected in panel (a) | |
| Panel d) | Individual tree detected | Display the individual trees and crowns detected on the CHM |
| Download CHM | Button for downloading CHM figure as .tif image. Requires CHM 2d to be selected in panel (a) | |
| Lorenz curve | Tree size heterogeneity analysis including the Lorenz curve (cumulative proportions) of detected tree heights, their Gini coefficient and the proportion taller than their mean | |
| Download Lorenz Curve | Button for downloading Lorenz Curve results as .tif file. Requires that Lorenz Curve be selected in panel (a) | |
| Panel e) | Canopy height model and 3D trees detected | Displays a 3D scene showing either the CHM or a reconstruction of individual trees detected. The used can interact with this 3D plot changing the zoom and perspective. For visualization purpose, crown-based height is estimated as 40% of the tree height |
| Tree location (.csv) | Export the tree list containing their locations, heights, crown widths and crown areas | |
| Tree Crown (.shp) | Option for downloading the detected tree crowns as shapefile | |
| Tree Location (.shp) | Option for downloading the detected tree locations as shapefile | |
| Page 2: About | Description of the treetop tool and authors | |

2 treetop APPLICATIONS AND CASE STUDIES
treetop's main functionality is to detect and delineate individual tree crowns using CHMs derived from LiDAR or other remote sensing sources, and to generate forest structure information relevant to forest ecologists and conservationists, not requiring any specialized knowledge about LiDAR or remote sensing. The following three examples illustrate practical applications of the capabilities of the treetop for characterizing forest structure at tree level and their changes along timelines and across planted and natural forest ecosystems.
2.1 Forest disturbance detection using airborne and UAV-LiDAR multitemporal data and the treetop application
Hurricanes cause extensive damage to forest resources, in addition to the loss of life and other properties. The ecological effects of hurricanes on forest structure and function are not well-understood. They can be complex, including both harmful and beneficial effects. Assessing damages and monitoring forest structural changes following hurricanes is the first step to understanding complex ecological effects of hurricanes on forest and develop forest management approaches aimed at increasing forest resistance and resilience (Shiels et al., ).
Ecologically, hurricanes are part of a suite of natural disturbances that have historically shaped structure and function of forest ecosystems in the Gulf and Atlantic Coastal Plains of the United States. On 10 October 2018, a powerful hurricane named Michael made landfall in the Florida Panhandle (Klotzbach, 2018). The present case study was conducted in the Apalachicola National Forest in Florida Panhandle following hurricane Michael, which severely damaged large parts of this forest. We made a quick assessment of damage and disturbance on sites impacted by Hurricane Michael using LiDAR data and the treetop tool. Specifically, we used LiDAR data that were collected immediately prior to Hurricane Michael from an aircraft-borne LiDAR system. A UAV-LiDAR system (GatorEye system, see Supporting Information) collected data at the same site 2 months after the hurricane which was 6 months after the initial airborne flight. CHMs (0.5 m resolution) were computed using LAStools (Isenburg, 2018) and, for the purposes of this case study, we selected a 50 × 50 m sample plot in which individual trees were detected and delineated on the CHMs using FWS = 3 × 3 and SWS = 3 × 3, and MaxCrown and Exclusion parameters were set to 0.6 and 0.3 respectively (Figures S1 and S2).
Hurricane impacts were visually apparent between the collection dates in our sample site. The 32 trees initially detected were reduced to 24 trees following the hurricane. We found 38.5% reduction in canopy coverage with large increases in gaps and crown reductions in some remaining standing trees (Figure 4). No decrease in maximum tree height was detected within the plot; however, mean tree height decreased from 26.8 to 23 m, indicating that mortality of the canopy trees possibly occurred. Height distributions (Figure 5) can be used to calculate vertical leaf area density provided sufficient calibration data (Stark et al., 2012). Even without calibration, the assessment of these vertical profiles reveals a large increase in LiDAR echoes below 8 ms above the ground which is consistent with an increase in downed woody debris following the hurricane. However, for this small sample plot, a two-sample Kolmogorov–Smirnov (KS) test (Wayne, 1990) showed that the tree height distribution pre- and post-hurricane disturbance (Figure 5) did not significantly differ (KS = 0.23, p-value = 0.47 and α = 0.05).


2.2 Assessment of structural heterogeneity in forest plantations
The treetop tool was used to access forest structural heterogeneity in a 3-year-old fast-growing Eucalyptus grandis forest plantation (e.g. Silva et al., 2014) and in an 8-year-old seminal (seed) plantation of Pinus taeda (Figure 6) in southern Brazil (Klabin SA company, Paraná State, Brazil; Silva et al., 2017). LiDAR data were collected with pulse density of 4 pulses/m2 and CHM (0.5 m of resolution) was created using LAStools (Isenburg, 2018). Individual trees were detected and delineated in both plantation sites using treetop tool in a plot area of 0.25 ha (50 × 50 m2). ITD and crown delineation were performed using FWS = 3 × 3 and SWS = 3 × 3, and MaxCrown and Exclusion parameters were set to 0.6 and 0.3 respectively (Figures S3 and S4).

The structural heterogeneity of forests is typically assessed by a measurement of variability and a measurement of asymmetry (Knox et al., 1989; Valbuena et al., 2017). In our treetop tool, we chose to evaluate variability and asymmetry in the height of detected trees, because height above the ground is the variable directly measured by the LiDAR. Except for MacArthur and MacArthur's (1961) foliage height diversity (FHD), structural indices are more typically based on tree bole diameters because in the field they are more directly measurable than heights. One such measure of heterogeneity based on tree heights is the PH350 index (Hentz et al., 2018). To clarify the role of PH350 in evaluating forest heterogeneity, we computed Lorenz curves from the cubic power of tree heights, which has been observed to relate to Lorenz curves obtained from tree diameters (Hakamada et al., 2015). Lorenz plots for the two forest areas—(a) the E. grandis and (b) P. taeda plantations (Figure 7)—both showed a high degree of homogeneity in their structure, which can be observed by the low amplitude of their Lorenz curves, close to the diagonal (absolute equality). The Gini coefficient obtained from both of stands, GC = 0.17 and 0.11, respectively, are reflective of the Lorenz curve results (Weiner & Thomas, 1986). The upper part of the shaded area in Figure 7 shows the position of a Lorenz curve with a maximum value for MacArthur and MacArthur's (1961) FHD, as demonstrated by Valbuena et al. (2012) depiction of maximum entropy over the Lorenz plot.

More apparent differences between plantations can be observed when considering the measures of asymmetry. Damgaard and Weiner (2000) envisaged a method to evaluate the asymmetry of a Lorenz curve by comparing the position of its inflection point (a crossed circle in Figure 7) against the axis of symmetry of a Lorenz plot (dashed line in Figure 7). Complete symmetry is denoted by an index value of S = 1 (Damgaard & Weiner, 2000). Our case study plots showed values of 1.03 and 1.18, respectively, which reveals the P. taeda forests to have a more heterogeneous structure. In these two case studies, we observed values of PH3 = 0.55 and 0.64, and PH350 = 0.58 and 0.61 respectively (in Figure 7, PH3 is denoted by a crossed circle and PH350 by a red arrow). These are just a few examples of how ecologists, forest science experts, foresters and other practitioners can benefit from the outputs automatically yielded by the Web-LiDAR treetop application and the R treetop package.
2.3 Spatial patterns of individual trees in tropical forest
In our third case study, the treetop tool was used for ITD and crown delineation within a plot of 2.25 ha in a tropical forest site in the Western Brazilian Amazon to analyse the spatial distribution of trees by using Ripley's K functions (Ripley, 1976). The LiDAR data were collected at the Adolfo Ducke Forest Reserve in Manaus, state of Amazonas, Brazil (dos-Santos & Keller, 2015) with a pulse density of 22.7 points/m2 in 2012. CHMs (0.5 × 0.5 m) were created using LAStools (Isenburg, 2018) for ITD and crown boundary delineations (Silva et al., 2016). ITD was performed using FWS = 7 × 7 and SWS = 7 × 7, and MaxCrown and Exclusion parameters were set to 0.4 and 0.7 respectively (Figures S5). The treetop detected 75 trees with mean (± SD) height of 33.47 m (± 4.93) and a mean crown area of 213.79 m2 (± 86.96) (Figure 8).

Ripley's K and L functions (Besag, 1977; Ripley, 1976) and the Clark–Evans index (Clark & Evans, 1954) were used to examine spatial patterns followed by the detected trees in the 2.25-ha plot in the Adolfo Ducke Forest Reserve. Ripley's function calculates distances (r) between individual pairs of trees and compares them to what would be expected from a purely random (Poisson) point process. The empirical K function observed from spatial distribution of trees (Kobs (r); black solid lines in Figure 9) is compared against the theoretical K function (Ktheo (r) = πr2; red dashed line in Figure 9). The grey-shaded areas in Figure 9 are confidence intervals for the random process developed by Monte Carlo simulations (Baddeley et al., ). Random variability and large ranges of values in the point intensity (y-axis) makes it difficult to analyse the differences between both curves (Figure 9a). For this reason, Besag (1977) proposed the L function, as a transformation of the K function, Lobs (r) = , where the theoretical L function becomes Ltheo (r) = r (Figure 9b). Finally, a further transformation into the function, obtained after subtracting the distance r from the L values, which makes Ripley's function and the confidence intervals for a random process easiest to visualize and analyse (Baddeley et al., ). Clark and Evans (1954) index (R) summarizes the information of Ripley's function into a single indicator with values R = 1 representing a random process, R < 1 a mechanism of attraction resulting in aggregated spatial patterns and R > 1 a mechanism of inhibition which results in spatial regularity (Figure 9c).

The results obtained in the Adolfo Ducke Forest Reserve plot with the treetop application showed signs of mechanisms inhibiting the growth of large trees close to one another (Figure 9). This is revealed by the empirically observed Ripley's K function laying below the confidence intervals for random process for distances around r = 4–15 m. The overall value of Clark-Evans index R = 1.48; from an ecological viewpoint, this indicates the mechanism of size-asymmetric competition between these trees which inhibit the growth of a tree in proximity of another (Weiner, 1990), which is in agreement with the natural growth conditions of this forest (DeMalach et al., 2016; Freckleton & Watkinson, 2001).
3 FINAL CONSIDERATIONS
We have provided an overview of the design and usage of treetop, the first web-based application and R package for ecologists and conservationist to automatically extract and analyse forest information from LiDAR-CHM data. The tool provides five panels which were described in detail, and functionality exemplified with three case studies using LiDAR datasets collected from disparate forest ecosystems, illustrating the ecological meaning of the analyses included in the application. The paper presents case studies focused on mostly forested areas; however, the tool can be applied in non-forested (e.g. urban) areas as well. We hope this web-based application will assist non-specialized practitioners of ecology and conservation world-wide towards better understanding the relationships between forest structure and function in different ecosystems. treetop is open-source software and the source code as well as the datasets used in this study are available on the treetop GitHub repository (https://github.com/carlos-alberto-silva/weblidar-treetop).
ACKNOWLEDGEMENTS
The authors thank Nicholas L. Crookston for co-developing the web-LiDAR treetop tool, and the two anonymous reviewers for their helpful suggestions on the first version of the manuscript. This study is based on the work supported by the Department of Defence Strategic Environmental Research and Development Program (SERDP) under grants No. RC-2243, RC19-1064 and RC20-1346 and USDA Forest Service (grand No. PRO00031122).
CONFLICT OF INTERESTS
The authors have no conflict of interest.
AUTHORS' CONTRIBUTIONS
All the authors have made a substantial contribution towards the successful completion of this manuscript. They all have been involved in designing the study, drafting the manuscript and engaging in critical discussion. C.A.S., A.T.H., L.A.V., R.V. and C.K. contributed to the development of the web-LiDAR tool; A.C., M.M., D.R.A.d.A., E.N.B., A.M.A.Z., B.W., A.S., J.B.D., P.B.M., J.G.V. and G.A.P. contribute with the data processing, data analysis and write-up; A.T.H., L.A.V., E.N.B., D.J.J., J.W.A. and R.V. contributed to the interpretation, quality control and revisions of the manuscript. All authors read and approved the final manuscript.